import request from '@/utils/request'

// 查看地址段
export function listNetwork(page,page_size,query) {
  return request({
    url: `/admin/ip_mac/network/?page=${page}&page_size=${page_size}`,
    method: 'get',
    params: query
  })
}

// 地址段过滤
export function listNetwork_Filter(query) {
  return request({
    url: '/admin/ip_mac/filter_network/',
    method: 'get',
    params: query
  })
}

// 历史MAC
export function listMac_Filter(query) {
  return request({
    url: '/admin/ip_mac/history_ip/',
    method: 'get',
    params: query
  })
}

// ip过滤
export function listIP_Filter(query) {
  return request({
    url: '/admin/ip_mac/filter_ip/',
    method: 'get',
    params: query
  })
}

// 修改地址段
export function updateNetwork(id,query) {
    return request({
      url: `/admin/ip_mac/network/${id}/`,
      method: 'put',
      data:query
    })
  }
  
  
  // 删除地址段
  export function delNetwork(query) {
    return request({
      url: `/admin/ip_mac/network/${query}/`,
      method: 'delete',
      data:query
    })
  }
  
  //新增地址段
  export function addNetwork(data) {
      return request({
        url: `/admin/ip_mac/network/`,
        method: 'post',
        data
      })
  }



  // 查看ipmac
export function listIPMAC(query) {
  return request({
    url: '/admin/ip_mac/ip_mac/',
    method: 'get',
    params: query
  })
}

// 修改ipmac
export function updateIPMAC(id,query) {
    return request({
      url: `/admin/ip_mac/ip_mac/${id}/`,
      method: 'put',
      data:query
    })
  }
  
  
  // 删除ipmac
  export function delIPMAC(query) {
    return request({
      url: `/admin/ip_mac/ip_mac/${query}/`,
      method: 'delete',

    })
  }
  
  //新增ipmac
  export function addIPMAC(data) {
      return request({
        url: `/admin/ip_mac/ip_mac/`,
        method: 'post',
        data
      })
  }
